package com.quanyan.alipay.protocal;

import com.quanyan.alipay.config.AlipayConfig;
import com.quanyan.alipay.util.UtilDate;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @author songzj
 * @date 16/7/11-15:57
 */
public class AlipayRefundNoPwdData {

    private Map<String, String> stringMap = new HashMap<>();

    public AlipayRefundNoPwdData(String batch_no, String tsn, BigDecimal refundAmount, String remark, AlipayConfig alipayConfig) {
        stringMap.put("service", "refund_fastpay_by_platform_nopwd");
        stringMap.put("partner", alipayConfig.getPartner());
        stringMap.put("_input_charset", alipayConfig.getInput_charset());
        stringMap.put("notify_url", alipayConfig.getRefund_notify_url());
        stringMap.put("batch_no", batch_no);
        stringMap.put("refund_date", UtilDate.getDateFormatter());
        stringMap.put("batch_num", "1");
        stringMap.put("detail_data", tsn + "^" + refundAmount + "^" + remark);
    }

    public Map<String, String> getStringMap() {
        return stringMap;
    }

    public static class AliPayRefundResult{
        private String is_success;
        private String error;

        public String getIs_success() {
            return is_success;
        }

        public void setIs_success(String is_success) {
            this.is_success = is_success;
        }

        public String getError() {
            return error;
        }

        public void setError(String error) {
            this.error = error;
        }
    }
}
